package ops.view;

import java.awt.BorderLayout;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;

import javax.imageio.ImageIO;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JPanel;

public class LoggedUserPanel extends JPanel {

	private JPanel logoPanel;
	
	public LoggedUserPanel() throws MalformedURLException {
		super(new BorderLayout());

		init();
	}
	
	private void init() throws MalformedURLException {
		
		logoPanel = new JPanel(new BorderLayout());
		
		initLogo();
	
		add(logoPanel, BorderLayout.CENTER);
	}
	
	private void initLogo() throws MalformedURLException {
		
		String path = "images/ops.jpg";
		File file = new File(path);
		BufferedImage image = null;
		try {
			image = ImageIO.read(file);
		} catch (IOException e) {
			e.printStackTrace();
		}
        JLabel label = new JLabel(new ImageIcon(image));
        
        logoPanel.add(label, BorderLayout.CENTER);
	}
}
